home *** CD-ROM | disk | FTP | other *** search
/ Corel Professional Photos 376: People 2 / Corel Stock Photo Library 2 - 376 - People II.iso / utils / setup / corelcd.mst < prev    next >
Text File  |  1995-01-27  |  23KB  |  694 lines

  1. '**************************************************************************
  2. '*           MSSetup Toolkit - Corel Professional Photos Setup            *
  3. '**************************************************************************
  4.  
  5. '$DEFINE DEBUG  ''Define for script development/debugging
  6.  
  7. '$INCLUDE 'setupapi.inc'
  8. '$INCLUDE 'msdetect.inc'
  9.  
  10. CONST WS_VISIBLE=&H10000000
  11. CONST WS_BORDER =&H00800000
  12. CONST WS_CLIPCHILDREN =&H02000000
  13. CONST GWL_STYLE =-16
  14. CONST SW_SHOWMAXIMIZED=3
  15.  
  16. DECLARE FUNCTION ShowWindow LIB "user.exe" (hWnd%,iShow%) AS INTEGER
  17. DECLARE FUNCTION SetWindowLong LIB "user.exe" (hWnd%,offset%,style&) AS LONG
  18.  
  19. hWnd%=HwndFrame()
  20.  
  21. sti&=SetWindowLong(hWnd%,GWL_STYLE,WS_VISIBLE+WS_BORDER+WS_CLIPCHILDREN)
  22. stj%=ShowWindow(hWnd%,SW_SHOWMAXIMIZED)
  23.  
  24. ''Dialog ID's
  25. CONST WELCOME      = 100
  26. CONST ASKQUIT      = 200
  27. CONST DESTPATH     = 300
  28. CONST EXITFAILURE  = 400
  29. CONST EXITQUIT     = 600
  30. CONST EXITSUCCESS  = 700
  31. CONST ASKQTOUR     = 800
  32. CONST APPHELP      = 900
  33. CONST CUSTINST     = 6200
  34. CONST TOOBIG       = 6300
  35. CONST BADPATH      = 6400
  36. CONST MOSAIC       = 7100
  37. CONST PCDSCSI      = 7200
  38. CONST CDAUDIO      = 7300
  39. CONST VIDEOWARN    = 7500
  40.  
  41. ''Bitmap ID
  42. CONST LOGO         = 1
  43.  
  44. ''File Types
  45. CONST PCDLABFILES    = 1
  46. CONST PCDMOSFILES    = 2
  47. CONST PCDAUDFILES    = 3
  48. CONST PCDSCRFILES    = 4
  49. CONST PCDWALFILES    = 5
  50. CONST PCDQTRFILES    = 6
  51.  
  52. GLOBAL DEST$        ''Default destination directory.
  53. GLOBAL WINDRIVE$    ''Windows drive letter.
  54. GLOBAL MosDir$      ''Location of old mosaic program, if found.
  55. GLOBAL MosFlag$      ''Flag for old mosaic program, if found.
  56. GLOBAL QTRFlag$     ''Flag for QuickTour
  57. GLOBAL MPlrFlag     ''Flag for Media Player 
  58.  
  59. FLAG1$          ="No"      '' Copy flags for
  60. FLAG2$          ="No"      '' DLL files that go
  61. FLAG3$          ="No"      '' into WindowsDir and WindowsSysDir
  62. QTRFlag$        ="NO"
  63.  
  64. ''CustInst list symbol names
  65. GLOBAL PCDLABNEEDS$    ''Option list costs per drive
  66. GLOBAL PCDMOSNEEDS$
  67. GLOBAL PCDAUDNEEDS$
  68. GLOBAL PCDSCRNEEDS$
  69. GLOBAL PCDWALNEEDS$
  70. GLOBAL PCDQTRNEEDS$
  71.  
  72. GLOBAL EXTRACOSTS$  ''List of extra costs to add per drive
  73. GLOBAL BIGLIST$     ''List of option files cost calc results (boolean)
  74.  
  75. ''Dialog list symbol names
  76. GLOBAL CHECKSTATES$
  77. GLOBAL STATUSTEXT$
  78. GLOBAL DRIVETEXT$
  79.  
  80.  
  81. DECLARE SUB AddOptFilesToCopyList (ftype%)
  82. DECLARE SUB RecalcOptFiles (ftype%)
  83. DECLARE SUB RecalcPath
  84. DECLARE SUB SetDriveStatus
  85. DECLARE FUNCTION MakePath (szDir$, szFile$) AS STRING
  86. DECLARE FUNCTION VflatdPresent LIB "iniupd.dll" AS INTEGER
  87.  
  88. INIT:
  89.     CUIDLL$ = "mscuistf.dll"            ''custom user interface dll
  90.     HELPPROC$ = "FHelpDlgProc"          ''Help dialog procedure
  91.  
  92.     SetBitmap CUIDLL$, LOGO
  93.     SetTitle "Corel Professional Photos Setup"
  94.  
  95.     szInf$ = GetSymbolValue("STF_SRCINFPATH")
  96.     IF szInf$ = "" THEN
  97.     szInf$ = GetSymbolValue("STF_CWDDIR") + "CORELCD.INF"
  98.     END IF
  99.     ReadInfFile szInf$
  100.  
  101.     WINDRIVE$ = MID$(GetWindowsDir, 1, 1)
  102.     WINDIR$ = GetWindowsDir()
  103.     DEST$ = ucase$(WINDRIVE$) + ":\CORELCD"
  104.  
  105.     ''CustInst list symbols
  106.     CHECKSTATES$ = "CheckItemsState"
  107.     STATUSTEXT$  = "StatusItemsText"
  108.     DRIVETEXT$   = "DriveStatusText"
  109.     FOR i% = 1 TO 6 STEP 1
  110.     AddListItem CHECKSTATES$, "ON"
  111.     NEXT i%
  112.     FOR i% = 1 TO 6 STEP 1
  113.     AddListItem STATUSTEXT$, ""
  114.     NEXT i%
  115.     FOR i% = 1 TO 7 STEP 1
  116.     AddListItem DRIVETEXT$, ""
  117.     NEXT i%
  118.     ReplaceListItem DRIVETEXT$, 7, DEST$
  119.  
  120.     ''Disk cost list symbols
  121.     PCDLABNEEDS$  = "PcdLabNeeds"
  122.     PCDMOSNEEDS$  = "PcdMosNeeds"
  123.     PCDAUDNEEDS$  = "PcdAudNeeds"
  124.     PCDSCRNEEDS$  = "PcdScrNeeds"
  125.     PCDWALNEEDS$  = "PcdWalNeeds"
  126.     PCDQTRNEEDS$  = "PcdQtrNeeds"
  127.     EXTRACOSTS$ = "ExtraCosts"
  128.     BIGLIST$    = "BigList"
  129.     FOR i% = 1 TO 6 STEP 1
  130.     AddListItem BIGLIST$, ""
  131.     NEXT i%
  132.     FOR i% = 1 TO 26 STEP 1
  133.     AddListItem EXTRACOSTS$, "0"
  134.     NEXT i%
  135.  
  136.     MPlrFlag = DoesFileExist(MakePath(WinDir$, "mplayer.reg"), femExists)
  137.  
  138.     RecalcPath
  139.     SetDriveStatus
  140.  
  141. '$IFDEF DEBUG
  142.     i% = SetSizeCheckMode(scmOnIgnore)    '' could use scmOff; def = scmOnFatal
  143. '$ENDIF ''DEBUG
  144.  
  145.  
  146. WELCOME:
  147.     sz$ = UIStartDlg(CUIDLL$, WELCOME, "FInfoDlgProc", APPHELP, HELPPROC$)
  148.     IF sz$ = "CONTINUE" THEN
  149.     UIPop 1
  150.     ELSE
  151.     GOSUB ASKQUIT
  152.     GOTO WELCOME
  153.     END IF
  154.  
  155.  
  156. CUSTINST:
  157.     sz$ = UIStartDlg(CUIDLL$, CUSTINST, "FCustInstDlgProc", APPHELP, HELPPROC$)
  158.  
  159.     IF sz$ = "CONTINUE" THEN
  160.     ''Install only if it will fit.
  161.     FOR i% = 1 TO 6 STEP 1
  162.         IF GetListItem(BIGLIST$, i%) <> "" THEN
  163.         GOSUB TOOBIG
  164.         GOTO CUSTINST
  165.         END IF
  166.     NEXT i%
  167.     UIPop 1
  168.     GOTO INSTALL
  169.     ELSEIF sz$ = "PATH" THEN
  170.     GOTO GETPATH
  171.     ELSEIF sz$ = "CHK1" THEN
  172.     RecalcOptFiles PCDLABFILES
  173.     SetDriveStatus
  174.     GOTO CUSTINST
  175.     ELSEIF sz$ = "CHK2" THEN
  176.     RecalcOptFiles PCDMOSFILES
  177.     SetDriveStatus
  178.     GOTO CUSTINST
  179.     ELSEIF sz$ = "CHK3" THEN
  180.     RecalcOptFiles PCDAUDFILES
  181.     SetDriveStatus
  182.     GOTO CUSTINST
  183.     ELSEIF sz$ = "CHK4" THEN
  184.     RecalcOptFiles PCDSCRFILES
  185.     SetDriveStatus
  186.     GOTO CUSTINST
  187.     ELSEIF sz$ = "CHK5" THEN
  188.     RecalcOptFiles PCDWALFILES
  189.     SetDriveStatus
  190.     GOTO CUSTINST
  191.     ELSEIF sz$ = "CHK6" THEN
  192.     RecalcOptFiles PCDQTRFILES
  193.     SetDriveStatus
  194.     GOTO CUSTINST
  195.     ELSEIF sz$ = "REACTIVATE" THEN
  196.     RecalcPath
  197.     SetDriveStatus
  198.     GOTO CUSTINST
  199.     ELSE
  200.     GOSUB ASKQUIT
  201.     GOTO CUSTINST
  202.     END IF
  203.  
  204.  
  205.  
  206. INSTALL:
  207.     ClearCopyList
  208.     AddOptFilesToCopyList PCDLABFILES
  209.     AddOptFilesToCopyList PCDMOSFILES
  210.     AddOptFilesToCopyList PCDAUDFILES
  211.     AddOptFilesToCopyList PCDSCRFILES
  212.     AddOptFilesToCopyList PCDWALFILES
  213.     AddOptFilesToCopyList PCDQTRFILES
  214.     CreateDir DEST$, cmoNone
  215.     
  216.     IF GetListItem(CHECKSTATES$, PCDLABFILES) = "ON" THEN
  217.      IF DoesIniKeyExist("WIN.INI", "PhotoCD Lab", "Dir") = 1 THEN
  218.          PcdDir$ = GetIniKeyString("WIN.INI", "PhotoCD Lab", "Dir")
  219.          IF DoesFileExist(PcdDir$ + "\PCDLAB.EXE", femExists) = 1 THEN
  220.          SetSymbolValue "ConfirmTextIn", PcdDir$
  221.          SetSymbolValue "EditFocus", "END"
  222.          sz$ = UIStartDlg(CUIDLL$, PCDSCSI, "FConfirmDlgProc", APPHELP, HELPPROC$)
  223.          IF sz$ = "BACK" THEN
  224.              UIPop 1
  225.              GOTO CUSTINST
  226.          ELSEIF sz$ = "CONTINUE" THEN
  227.              UIPop 1
  228.          END IF
  229.          END IF
  230.      END IF
  231.      IF PcdDir$ <> "" THEN
  232.          CreateIniKeyValue "WIN.INI", "PhotoCD Lab", "Dir", PcdDir$, cmoOverwrite
  233.      ELSE
  234.          CreateIniKeyValue "WIN.INI", "PhotoCD Lab", "Dir", DEST$ + "\PCDLAB", cmoOverwrite
  235.      END IF
  236.     END IF
  237.  
  238.     IF GetListItem(CHECKSTATES$, PCDMOSFILES) = "ON" THEN
  239.      IF MosFlag$ <> "" THEN
  240.          SetSymbolValue "ConfirmTextIn", MosDir$
  241.          SetSymbolValue "EditFocus", "END"
  242.          sz$ = UIStartDlg(CUIDLL$, MOSAIC, "FConfirmDlgProc", APPHELP, HELPPROC$)
  243.          IF sz$ = "BACK" THEN
  244.              UIPop 1
  245.              GOTO CUSTINST
  246.          ELSEIF sz$ = "CONTINUE" THEN
  247.              UIPop 1
  248.          END IF
  249.      ELSEIF MosFlag$ = "" AND MOSDIR$ <> "" THEN
  250.          '' Just sit there for now
  251.      ELSE
  252.          CreateIniKeyValue "WIN.INI", "CorelGraphics4", "Dir", DEST$ + "\MOSAIC\CONFIG", cmoOverwrite
  253.          CreateDir DEST$ + "\MOSAIC\CONFIG", cmoNone
  254.          CreateIniKeyValue DEST$ + "\MOSAIC\CONFIG\CORELAPP.INI", "Config", "ProgramsDir", DEST$ + "\MOSAIC\PROGRAMS", cmoOverwrite
  255.          CreateIniKeyValue DEST$ + "\MOSAIC\CONFIG\CORELAPP.INI", "Config", "CustomDir", DEST$ + "\MOSAIC\CUSTOM", cmoOverwrite
  256.          CreateIniKeyValue DEST$ + "\MOSAIC\CONFIG\CORELAPP.INI", "Config", "MosaicDir", DEST$ + "\MOSAIC\PROGRAMS", cmoOverwrite
  257.          CreateIniKeyValue DEST$ + "\MOSAIC\CONFIG\CORELAPP.INI", "Config", "FiltersDir", DEST$ + "\MOSAIC\PROGRAMS", cmoOverwrite
  258.          CreateIniKeyValue DEST$ + "\MOSAIC\CONFIG\CORELAPP.INI", "Config", "DataDir", DEST$ + "\MOSAIC\PROGRAMS\DATA", cmoOverwrite
  259.      END IF
  260.      END IF
  261.     
  262.     IF GetListItem(CHECKSTATES$, PCDAUDFILES) = "ON" THEN
  263.      IF DoesIniKeyExist("WIN.INI", "CorelSCSI", "CD-Audio") = 1 THEN
  264.          CDAudioDir$ = GetIniKeyString("WIN.INI", "CorelSCSI", "CD-Audio")
  265.          IF DoesFileExist(CDAudioDir$ + "\CD_AUDIO.EXE", femExists) = 1 THEN
  266.          SetSymbolValue "ConfirmTextIn", CDAudioDir$
  267.          SetSymbolValue "EditFocus", "END"
  268.          sz$ = UIStartDlg(CUIDLL$, CDAUDIO, "FConfirmDlgProc", APPHELP, HELPPROC$)
  269.          IF sz$ = "BACK" THEN
  270.              UIPop 1
  271.              GOTO CUSTINST
  272.          ELSEIF sz$ = "CONTINUE" THEN
  273.              UIPop 1
  274.          END IF
  275.          END IF
  276.      END IF
  277.      CreateIniKeyValue "WIN.INI", "CorelSCSI", "CD-Audio", DEST$ + "\PCDAUDIO", cmoOverwrite
  278.     END IF
  279.  
  280.     IF GetListItem(CHECKSTATES$, PCDQTRFILES) = "ON" THEN
  281.       IF VflatdPresent() = 0 THEN
  282.      CreateSysIniKeyValue WinDir$ + "system.ini", "386Enh", "device", "dva.386", cmoOverwrite
  283.       END IF
  284.       CreateIniKeyValue WinDir$ + "system.ini", "Drivers", "VIDC.CVID", "iccvid.drv", cmoOverwrite
  285.       CreateIniKeyValue WinDir$ + "system.ini", "Drivers", "VIDC.MSVC", "msvidc.drv", cmoOverwrite
  286.       CreateIniKeyValue WinDir$ + "system.ini", "Drivers", "VIDC.IV31", "indeov.drv", cmoOverwrite
  287.       CreateIniKeyValue WinDir$ + "system.ini", "Drivers", "VIDC.MRLE", "MSRLE.drv", cmoOverwrite
  288.       IF DoesIniKeyExist (GetWindowsSysDir + "system.ini", "Drivers", "VIDC.RT21") = 0 THEN
  289.     CreateIniKeyValue WinDir$ + "system.ini", "Drivers", "VIDC.RT21", "indeov.drv", cmoOverwrite
  290.       END IF
  291.       CreateIniKeyValue WinDir$ + "system.ini", "Drivers", "VIDC.YVU9", "indeov.drv", cmoOverwrite
  292.       CreateIniKeyValue WinDir$ + "WIN.INI", "mci extensions", "avi", "AVIVideo", cmoOverwrite
  293.       CreateIniKeyValue WinDir$ + "system.ini", "mci", "AVIVideo", "mciavi.drv", cmoOverwrite
  294.       CreateIniKeyValue WinDir$ + "system.ini", "Drivers", "WaveMapper", "msacm.drv", cmoOverwrite
  295.       CreateIniKeyValue WinDir$ + "system.ini", "Drivers", "MSACM.msadpcm", "msadpcm.acm", cmoOverwrite
  296.       CreateIniKeyValue WinDir$ + "system.ini", "Drivers", "MSACM.imaadpcm", "imaadpcm.acm", cmoOverwrite
  297.       CreateIniKeyValue WinDir$ + "control.ini", "drivers.desc", "msacm.drv", "Microsoft Sound Mapper V2.00", cmoOverwrite
  298.       CreateIniKeyValue WinDir$ + "control.ini", "drivers.desc", "msadpcm.acm", "Microsoft ADPCM Codec V2.00", cmoOverwrite
  299.       CreateIniKeyValue WinDir$ + "control.ini", "drivers.desc", "imaadpcm.acm", "Microsoft IMA ADPCM Codec V2.00", cmoOverwrite
  300.     END IF
  301.  
  302.     CopyFilesInCopyList
  303.  
  304.     InstDrive$=MID$(DEST$,1,2)
  305.     CreateProgmanGroup "Professional Photos", "", cmoNone
  306.     IF GetListItem(CHECKSTATES$, PCDLABFILES) = "ON" THEN
  307.     ShowProgmanGroup "Professional Photos", 1, cmoNone
  308.     CreateProgmanItem "Professional Photos", "PhotoCD Lab", MakePath(DEST$, "pcdlab\pcdlab.exe "), "", cmoOverwrite
  309.     END IF
  310.  
  311.     IF GetListItem(CHECKSTATES$, PCDMOSFILES) = "ON" THEN
  312.     ShowProgmanGroup "Professional Photos", 1, cmoNone
  313.     IF MosDir$ <> "" THEN
  314.         CreateProgmanItem "Professional Photos", "CorelMOSAIC!", MosDir$ + "\CORELMOS.EXE", "", cmoOverwrite
  315.     ELSE
  316.         CreateProgmanItem "Professional Photos", "CorelMOSAIC!", MakePath(DEST$, "mosaic\programs\corelmos.exe "), "", cmoOverwrite
  317.         CreateIniKeyValue DEST$ + "\MOSAIC\CONFIG\CORELFLT.INI", "ColorPath", "CircuitPath", DEST$ + "\MOSAIC\CUSTOM", cmoOverwrite
  318.         CreateIniKeyValue DEST$ + "\MOSAIC\CONFIG\CORELFLT.INI", "ColorPath", "CurvePath", DEST$ + "\MOSAIC\CUSTOM", cmoOverwrite
  319.         CreateIniKeyValue DEST$ + "\MOSAIC\CONFIG\CORELPRN.INI", "ColorPath", "CircuitPath", DEST$ + "\MOSAIC\CUSTOM", cmoOverwrite
  320.     END IF
  321.     END IF
  322.  
  323.     IF GetListItem(CHECKSTATES$, PCDAUDFILES) = "ON" THEN
  324.     ShowProgmanGroup "Professional Photos", 1, cmoNone
  325.     CreateProgmanItem "Professional Photos", "CD Audio", MakePath(DEST$, "pcdaudio\cd_audio.exe "), "", cmoOverwrite
  326.     END IF
  327.  
  328.     IF GetListItem(CHECKSTATES$, PCDSCRFILES) = "ON" THEN
  329.     ShowProgmanGroup "Professional Photos", 1, cmoNone
  330.     END IF
  331.  
  332.     IF GetListItem(CHECKSTATES$, PCDWALFILES) = "ON" THEN
  333.     ShowProgmanGroup "Professional Photos", 1, cmoNone
  334.     CreateProgmanItem "Professional Photos", "Wallpaper Flipper Configuration", MakePath(GetWindowsDir, "wflipcnf.exe"), "", cmoOverwrite
  335.     END IF
  336.  
  337.     IF GetListItem(CHECKSTATES$, PCDQTRFILES) = "ON" THEN
  338.     ShowProgmanGroup "Professional Photos", 1, cmoNone
  339.     CreateProgmanItem "Accessories", "Media Player", MakePath(WinDir$, "mplayer.exe"), "", cmoOverwrite
  340.     CreateProgmanItem "Professional Photos", "Professional Photos QuickTour", GetSymbolValue("STF_SRCDIR")+"utils\cppqtour\qtviewer.exe", "", cmoOverwrite
  341.     END IF
  342.     CreateProgmanItem "Professional Photos", "Getting Started", MakePath(DEST$,"g_start.hlp"), "", cmoOverwrite 
  343.     CreateProgmanItem "Professional Photos", "Artview Screen Saver Help", MakePath(DEST$,"artview.hlp"), "", cmoOverwrite 
  344.     CreateProgmanItem "Professional Photos", "Corel Products Showcase", GetSymbolValue("STF_SRCDIR")+"showcase\show2.exe", "", cmoOverwrite 
  345.  
  346. QUIT:
  347.     ON ERROR GOTO ERRQUIT
  348.  
  349.     IF ERR = 0 THEN
  350.     dlg% = EXITSUCCESS
  351.     ELSEIF ERR = STFQUIT THEN
  352.     dlg% = EXITQUIT
  353.     ELSE
  354.     dlg% = EXITFAILURE
  355.     END IF
  356. QUITL1:
  357.     sz$ = UIStartDlg(CUIDLL$, dlg%, "FInfo0DlgProc", 0, "")
  358.     IF sz$ = "REACTIVATE" THEN
  359.     GOTO QUITL1
  360.     END IF
  361.     UIPop 1
  362.     IF QTRFlag$ = "YES" AND dlg% = EXITSUCCESS THEN
  363.       displayname$ = GetIniKeyString(WinDir$ + "SYSTEM.INI", "BOOT.DESCRIPTION", "DISPLAY.DRV")
  364.       FOR a% = 1 TO LEN(displayname$) - 4
  365.     checkname$ = MID$(displayname$, a%, 4)
  366.     IF checkname$ = "mach" THEN
  367.     machexist = 1
  368.     end if
  369.       NEXT a%
  370.       if machexist = 1 then
  371.     sz$ = UIStartDlg(CUIDLL$, VIDEOWARN, "FConfirmDlgProc", 0, "")
  372.     UIPop 1
  373.       end if
  374.       IF MPlrFlag <> 1 THEN
  375.     Run ("regedit.exe /s " + MakePath(WinDir$, "mplayer.reg"))
  376.     Run ("regedit.exe /s " + MakePath(WinSysDir$, "OLE2.reg"))
  377.     Run ("regedit.exe /s " + MakePath(WinSysDir$, "cleanup.reg"))
  378.     Run (GetSymbolValue("STF_SRCDIR")+"utils\setup\profdisp.exe")
  379.       END IF
  380.       sz$ = UIStartDlg(CUIDLL$, ASKQTOUR, "FConfirmDlgProc", 0, "")
  381.     IF sz$ = "CONTINUE" THEN
  382.       UIPop 1
  383.       CHDRIVE GetSymbolValue("STF_SRCDIR")
  384.       CHDIR "\utils\cppqtour"
  385.       Run ("qtviewer.exe")
  386.     ELSE
  387.       UIPop 1
  388.     END IF
  389.     END IF
  390.     END
  391.  
  392. ERRQUIT:
  393.     i% = DoMsgBox("Setup sources were corrupted, call Corel Tech Support", "Setup Message", MB_OK+MB_TASKMODAL+MB_ICONHAND)
  394.     END
  395.  
  396.  
  397.  
  398. GETPATH:
  399.     SetSymbolValue "EditTextIn", DEST$
  400.     SetSymbolValue "EditFocus", "END"
  401. GETPATHL1:
  402.     sz$ = UIStartDlg(CUIDLL$, DESTPATH, "FEditDlgProc", APPHELP, HELPPROC$)
  403.  
  404.     IF sz$ = "CONTINUE" THEN
  405.     olddest$ = DEST$
  406.     DEST$ = GetSymbolValue("EditTextOut")
  407.  
  408.     ''Validate new path.
  409.     IF IsDirWritable(DEST$) = 0 THEN
  410.         GOSUB BADPATH
  411.         GOTO GETPATHL1
  412.     END IF
  413.     UIPop 1
  414.  
  415.     ''Truncate display if too long.
  416.     IF LEN(DEST$) > 23 THEN
  417.         ReplaceListItem DRIVETEXT$, 7, MID$(DEST$, 1, 23)+"..."
  418.     ELSE
  419.         ReplaceListItem DRIVETEXT$, 7, DEST$
  420.     END IF
  421.  
  422.     ''Recalc if path changed.
  423.     IF (olddest$ <> DEST$) AND (olddest$ <> DEST$+"\") AND (olddest$+"\" <> DEST$) THEN
  424.         RecalcPath
  425.         SetDriveStatus
  426.     END IF
  427.  
  428.     olddest$ = ""
  429.     GOTO CUSTINST
  430.     ELSEIF sz$ = "REACTIVATE" THEN
  431.     RecalcPath
  432.     SetDriveStatus
  433.     GOTO GETPATHL1
  434.     ELSEIF sz$ = "EXIT" THEN
  435.     GOSUB ASKQUIT
  436.     GOTO GETPATHL1
  437.     ELSE
  438.     UIPop 1
  439.     GOTO CUSTINST
  440.     END IF
  441.  
  442.  
  443.  
  444. TOOBIG:
  445.     sz$ = UIStartDlg(CUIDLL$, TOOBIG, "FInfo0DlgProc", 0, "")
  446.     IF sz$ = "REACTIVATE" THEN
  447.     RecalcPath
  448.     SetDriveStatus
  449.     GOTO TOOBIG
  450.     END IF
  451.     UIPop 1
  452.     RETURN
  453.  
  454.  
  455.  
  456. BADPATH:
  457.     sz$ = UIStartDlg(CUIDLL$, BADPATH, "FInfo0DlgProc", 0, "")
  458.     IF sz$ = "REACTIVATE" THEN
  459.     RecalcPath
  460.     SetDriveStatus
  461.     GOTO BADPATH
  462.     END IF
  463.     UIPop 1
  464.     RETURN
  465.  
  466.  
  467.  
  468. ASKQUIT:
  469.     sz$ = UIStartDlg(CUIDLL$, ASKQUIT, "FQuitDlgProc", 0, "")
  470.  
  471.     IF sz$ = "EXIT" THEN
  472.     UIPopAll
  473.     ERROR STFQUIT
  474.     ELSEIF sz$ = "REACTIVATE" THEN
  475.     GOTO ASKQUIT
  476.     ELSE
  477.     UIPop 1
  478.     END IF
  479.     RETURN
  480.  
  481.  
  482.  
  483. '**
  484. '** Purpose:
  485. '**     Adds the specified option files to the copy list.
  486. '** Arguments:
  487. '**     ftype%  - type of files to add, one of the following:
  488. '**             PCDLABFILES, PCDAUDFILES, PCDMOSFILES, PCDSCRFILES, PCDWALFILES
  489. '** Returns:
  490. '**     none.
  491. '*************************************************************************
  492. SUB AddOptFilesToCopyList (ftype%) STATIC
  493.  
  494.     IF GetListItem(CHECKSTATES$, ftype%) = "ON" THEN
  495.     SrcDir$ = GetSymbolValue("STF_SRCDIR")
  496.     WinDirLen = LEN(GetWindowsDir)-1
  497.     WinDir$ = MID$(GetWindowsDir,1,WinDirLen)
  498.     InstDrive$ = MID$(DEST$,1,2)
  499.     IF ftype% = PCDLABFILES THEN
  500.         AddSectionFilesToCopyList "PcdLabFiles", SrcDir$, DEST$ + "\PCDLAB"
  501.         FLAG1$="Yes"
  502.         FLAG2$="Yes"
  503.         FLAG3$="Yes"
  504.     ELSEIF ftype% = PCDMOSFILES THEN
  505.      IF DoesIniKeyExist("WIN.INI", "CorelGraphics4", "Dir") = 1 THEN
  506.          CorelAppDir$ = GetIniKeyString("WIN.INI", "CorelGraphics4", "Dir")
  507.          MosDir$ = GetIniKeyString(CorelAppDir$ + "\CORELAPP.INI", "Config", "ProgramsDir")
  508.          IF MosDir$ <> "" THEN
  509.            IF DoesFileExist(MosDir$ + "\CORELMOS.EXE", femExists) = 1 THEN
  510.          MosFlag$ = "Yes"
  511.            ELSE
  512.          MosFlag$ = ""
  513.            END IF
  514.            AddSectionFilesToCopyList "PcdMosFiles", SrcDir$, MosDir$
  515.            AddSectionFilesToCopyList "PcdMosUtils", SrcDir$, MosDir$
  516.          ELSE
  517.           AddSectionFilesToCopyList "PcdMosFiles", SrcDir$, DEST$ + "\MOSAIC\PROGRAMS"
  518.           AddSectionFilesToCopyList "PcdMosUtils", SrcDir$, DEST$ + "\MOSAIC\CUSTOM"
  519.           AddSectionFilesToCopyList "PcdMosInis", SrcDir$, DEST$ + "\MOSAIC\CONFIG"
  520.           AddSectionFilesToCopyList "PcdMosData", SrcDir$, DEST$ + "\MOSAIC\PROGRAMS\DATA"
  521.          END IF 
  522.      ELSE 
  523.           AddSectionFilesToCopyList "PcdMosFiles", SrcDir$, DEST$ + "\MOSAIC\PROGRAMS"
  524.           AddSectionFilesToCopyList "PcdMosUtils", SrcDir$, DEST$ + "\MOSAIC\CUSTOM"
  525.           AddSectionFilesToCopyList "PcdMosInis", SrcDir$, DEST$ + "\MOSAIC\CONFIG"
  526.           AddSectionFilesToCopyList "PcdMosData", SrcDir$, DEST$ + "\MOSAIC\PROGRAMS\DATA"
  527.      END IF
  528.         FLAG1$="Yes"
  529.         FLAG3$="Yes"
  530.     ELSEIF ftype% = PCDAUDFILES THEN
  531.         AddSectionFilesToCopyList "PcdAudFiles", SrcDir$, DEST$ + "\PCDAUDIO"
  532.     ELSEIF ftype% = PCDSCRFILES THEN
  533.         AddSectionFilesToCopyList "PcdScrFiles", SrcDir$, GetWindowsDir
  534.         FLAG3$="Yes"
  535.     ELSEIF ftype% = PCDWALFILES THEN
  536.         AddSectionFilesToCopyList "PcdWalFiles", SrcDir$, GetWindowsDir
  537.     ELSEIF ftype% = PCDQTRFILES THEN
  538.         AddSectionFilesToCopyList "PcdQtrFiles", SrcDir$, GetWindowsDir
  539.         AddSectionFilesToCopyList "PcdQtrSysFiles", SrcDir$, GetWindowsSysDir
  540.         QtrFlag$="YES"
  541.     END IF
  542.     IF FLAG1$="Yes" THEN
  543.         CreateIniKeyValue "WIN.INI", "Extensions", "PCD", DEST$ + "\PCDLAB\PCDLAB.EXE ^.PCD", cmoNone
  544.         AddSectionFilesToCopyList "PcdDllFiles", SrcDir$, GetWindowsSysDir
  545.         IF DoesFileExist(GetWindowsDir + "PCDLIB.DLL", femExists) =1 THEN
  546.         RemoveFile GetWindowsDir + "PCDLIB.DLL", cmoNone
  547.         END IF
  548.         IF DoesFileExist(GetWindowsDir + "PCDXTIF.DLL", femExists) =1 THEN
  549.         RemoveFile GetWindowsDir + "PCDXTIF.DLL", cmoNone
  550.         END IF
  551.         IF DoesFileExist(GetWindowsDir + "PCDXEPS.DLL", femExists) =1 THEN
  552.         RemoveFile GetWindowsDir + "PCDXEPS.DLL", cmoNone
  553.         END IF
  554.         IF DoesFileExist(GetWindowsDir + "PCDXPCX.DLL", femExists) =1 THEN
  555.         RemoveFile GetWindowsDir + "PCDXPCX.DLL", cmoNone
  556.         END IF
  557.         IF DoesFileExist(GetWindowsDir + "PCDXBMP.DLL", femExists) =1 THEN
  558.         RemoveFile GetWindowsDir + "PCDXBMP.DLL", cmoNone
  559.         END IF
  560.     END IF
  561.     IF FLAG2$="Yes" THEN
  562.         AddSectionFilesToCopyList "PcdCtlFile", SrcDir$, GetWindowsSysDir
  563.     END IF
  564.     IF FLAG3$="Yes" THEN
  565.         AddSectionFilesToCopyList "PcdDllFile", SrcDir$, GetWindowsSysDir
  566.     END IF
  567.         AddSectionFilesToCopyList "PcdReadMe", SrcDir$, DEST$
  568.     FLAG1$="No"
  569.     FLAG2$="No"
  570.     FLAG3$="No"
  571.     SrcDir$ = ""
  572.     END IF
  573. END SUB
  574.  
  575. '**
  576. '** Purpose:
  577. '**     Recalculates disk space for the given option files and sets
  578. '**     the status info symbol "StatusItemsText".
  579. '** Arguments:
  580. '**     ftype% - type of files to add, one of the following:
  581. '**             PCDLABFILES, PCDMOSFILES, PCDAUDFILES, PCDSCRFILES, PCDWALFILES, PCDQTRFILES
  582. '** Returns:
  583. '**     none.
  584. '*************************************************************************
  585. SUB RecalcOptFiles (ftype%) STATIC
  586.     CursorSave% = ShowWaitCursor()
  587.     ClearCopyList
  588.     AddOptFilesToCopyList ftype%
  589.  
  590.     fExtra% = 0
  591.     IF ftype% = PCDLABFILES THEN
  592.     ListSym$ = PCDLABNEEDS$
  593.     ELSEIF ftype% = PCDMOSFILES THEN
  594.     ListSym$ = PCDMOSNEEDS$
  595.     ELSEIF ftype% = PCDAUDFILES THEN
  596.     ListSym$ = PCDAUDNEEDS$
  597.     ELSEIF ftype% = PCDSCRFILES THEN
  598.     ListSym$ = PCDSCRNEEDS$
  599.     ELSEIF ftype% = PCDWALFILES THEN
  600.     ListSym$ = PCDWALNEEDS$
  601.     ELSEIF ftype% = PCDQTRFILES THEN
  602.     ListSym$ = PCDQTRNEEDS$
  603.     IF QTRFlag$ = "YES" THEN
  604.     QTRFlag$ = "NO"
  605.     END IF
  606.     END IF
  607.  
  608.     StillNeed& = GetCopyListCost(EXTRACOSTS$, ListSym$, "")
  609.  
  610.     cost& = 0
  611.     FOR i% = 1 TO 26 STEP 1
  612.     cost&  = cost& + VAL(GetListItem(ListSym$, i%))
  613.     NEXT i%
  614.     ReplaceListItem STATUSTEXT$, ftype%, STR$(cost& / 1024) + " K"
  615.  
  616.     IF StillNeed& > 0 THEN
  617.     ReplaceListItem BIGLIST$, ftype%, "YES"
  618.     ELSE
  619.     ReplaceListItem BIGLIST$, ftype%, ""
  620.     END IF
  621.  
  622.     RestoreCursor CursorSave%
  623.     ListSym$ = ""
  624. END SUB
  625.  
  626.  
  627. '**
  628. '** Purpose:
  629. '**     Recalculates disk space and sets option status info according
  630. '**     to the current destination path.
  631. '** Arguments:
  632. '**     none.
  633. '** Returns:
  634. '**     none.
  635. '*************************************************************************
  636. SUB RecalcPath STATIC
  637.  
  638.     CursorSave% = ShowWaitCursor()
  639.  
  640.     RecalcOptFiles PCDLABFILES
  641.     RecalcOptFiles PCDMOSFILES
  642.     RecalcOptFiles PCDAUDFILES
  643.     RecalcOptFiles PCDSCRFILES
  644.     RecalcOptFiles PCDWALFILES
  645.     RecalcOptFiles PCDQTRFILES
  646.  
  647.     RestoreCursor CursorSave%
  648. END SUB
  649.  
  650.  
  651. '**
  652. '** Purpose:
  653. '**     Sets drive status info according to latest disk space calcs.
  654. '** Arguments:
  655. '**     none.
  656. '** Returns:
  657. '**     none.
  658. '*************************************************************************
  659. SUB SetDriveStatus STATIC
  660.  
  661.     drive$ = MID$(DEST$, 1, 1)
  662.     ndrive% = ASC(ucase$(drive$)) - ASC("A") + 1
  663.     cost& = VAL(GetListItem(PCDLABNEEDS$, ndrive%))+VAL(GetListItem(PCDMOSNEEDS$, ndrive%))+VAL(GetListItem(PCDAUDNEEDS$, ndrive%))+VAL(GetListItem(PCDSCRNEEDS$, ndrive%))+VAL(GetListItem(PCDWALNEEDS$, ndrive%))+VAL(GetListItem(PCDQTRNEEDS$, ndrive%))
  664.     free& = GetFreeSpaceForDrive(drive$)
  665.     ReplaceListItem DRIVETEXT$, 1, drive$ + ":"
  666.     ReplaceListItem DRIVETEXT$, 2, STR$(cost& / 1024) + " K"
  667.     ReplaceListItem DRIVETEXT$, 3, STR$(free& / 1024) + " K"
  668.                 
  669. END SUB
  670.  
  671.  
  672. '**
  673. '** Purpose:
  674. '**     Appends a file name to the end of a directory path,
  675. '**     inserting a backslash character as needed.
  676. '** Arguments:
  677. '**     szDir$  - full directory path (with optional ending "\")
  678. '**     szFile$ - filename to append to directory
  679. '** Returns:
  680. '**     Resulting fully qualified path name.
  681. '*************************************************************************
  682. FUNCTION MakePath (szDir$, szFile$) STATIC AS STRING
  683.     IF szDir$ = "" THEN
  684.     MakePath = szFile$
  685.     ELSEIF szFile$ = "" THEN
  686.     MakePath = szDir$
  687.     ELSEIF MID$(szDir$, LEN(szDir$), 1) = "\" THEN
  688.     MakePath = szDir$ + szFile$
  689.     ELSE
  690.     MakePath = szDir$ + "\" + szFile$
  691.     END IF
  692. END FUNCTION
  693.  
  694.